using UnityEngine;

public class CheckCollision : MonoBehaviour
{
	public BulletController theweapon;

	private Transform m_transform;

	public LayerMask layerMask;

	private Vector3 previousPosition;

	private Vector3 movedir;

	private float movedis;

	private RaycastHit hitInfo;

	private float minCheckDis = 1f;

	private void OnEnable()
	{
		m_transform = base.transform;
		previousPosition = m_transform.position;
	}

	private void FixedUpdate()
	{
		movedis = Vector3.Distance(previousPosition, m_transform.position);
		if (!(movedis >= minCheckDis))
		{
			return;
		}
		movedir = (m_transform.position - previousPosition).normalized;
		if (Physics.Raycast(previousPosition, movedir, out hitInfo, movedis, layerMask.value))
		{
			if (hitInfo.collider.gameObject.CompareTag("water"))
			{
				MonoBehaviour.print("water flower");
			}
			if (hitInfo.collider.gameObject.CompareTag("Terrain"))
			{
				MonoBehaviour.print("terrain smoke");
			}
		}
		previousPosition = m_transform.position;
	}
}
